.dashboard-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(141, 77, 59, 0.9), rgba(47, 99, 88, 0.9));
  border-radius: 8px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/models/paper_texture.png');
  background-size: 200px;
  opacity: 0.1;
  z-index: 0;
}

.dashboard-header h1, .dashboard-header p {
  position: relative;
  z-index: 1;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: white;
}

.dashboard-header p {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0.9;
}

.dashboard-controls {
  margin-bottom: 30px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.view-tab {
  padding: 10px 20px;
  margin-right: 5px;
  margin-bottom: 5px;
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--text-color);
  font-weight: 500;
}

.view-tab:hover {
  background-color: rgba(141, 77, 59, 0.1);
}

.view-tab.active {
  background-color: var(--primary-color);
  color: white;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;
}

.search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.category-filter {
  min-width: 200px;
}

.category-filter select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
}

.dashboard-content {
  margin-top: 20px;
}

/* 概览视图样式 */
.overview-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text-color);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.dashboard-quicklinks {
  margin-top: 20px;
}

.dashboard-quicklinks h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.quicklinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.quicklink-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quicklink-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background-color: var(--accent-color);
}

.quicklink-icon {
  font-size: 2rem;
  margin-bottom: 15px;
}

.quicklink-card h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.quicklink-card p {
  font-size: 0.9rem;
  color: var(--text-color);
}

.recent-herbs {
  margin-top: 20px;
}

.recent-herbs h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.herbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.herb-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.herb-card:hover {
  transform: translateY(-5px);
}

.herb-image {
  height: 120px;
  overflow: hidden;
}

.herb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.herb-card:hover .herb-image img {
  transform: scale(1.1);
}

.herb-card h4 {
  font-size: 1rem;
  padding: 10px 15px 5px;
  margin: 0;
}

.herb-card p {
  font-size: 0.8rem;
  padding: 0 15px 15px;
  color: var(--secondary-color);
  margin: 0;
}

/* 占位视图样式 */
.placeholder-view {
  background: white;
  padding: 40px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.placeholder-view h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.placeholder-view p {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dashboard-header h1 {
    font-size: 1.8rem;
  }
  
  .dashboard-header p {
    font-size: 1rem;
  }
  
  .view-tab {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
}

/* 分类体系视图样式 */
.classification-view {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dimension-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
  gap: 10px;
}

.dimension-tab {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  background: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-color);
}

.dimension-tab:hover {
  background-color: rgba(141, 77, 59, 0.1);
}

.dimension-tab.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.classification-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1200px) {
  .classification-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .classification-content {
    grid-template-columns: 1fr;
  }
}

.classification-tree {
  grid-column: span 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--background-color);
  max-height: 600px;
  overflow-y: auto;
}

.classification-tree h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.tree-container {
  margin-top: 15px;
}

.tree-category {
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: rgba(141, 77, 59, 0.1);
  cursor: pointer;
}

.category-name {
  font-weight: 500;
  flex-grow: 1;
}

.category-count {
  background-color: var(--primary-color);
  color: white;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.8rem;
  margin-right: 10px;
}

.expand-icon {
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.category-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.category-items.expanded {
  max-height: 500px;
  transition: max-height 0.5s ease-in;
}

.herb-item {
  padding: 8px 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.herb-item:last-child {
  border-bottom: none;
}

.herb-item:hover {
  background-color: rgba(141, 77, 59, 0.05);
}

.herb-item.selected {
  background-color: rgba(141, 77, 59, 0.2);
  font-weight: 500;
}

.classification-stats {
  grid-column: span 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: white;
}

.classification-stats h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bar-chart, .pie-chart {
  flex: 1;
  min-height: 200px;
}

.stat-bar-container {
  margin-bottom: 12px;
}

.stat-bar-label {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.stat-bar-wrapper {
  height: 20px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.stat-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease-out;
}

.stat-bar-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 500;
  color: #333;
}

.pie-chart-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.pie-legend {
  margin-top: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.legend-color {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
}

.legend-label {
  flex-grow: 1;
  font-size: 0.9rem;
}

.legend-value {
  font-weight: 500;
  font-size: 0.9rem;
}

.herb-detail-panel {
  grid-column: span 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: white;
  max-height: 600px;
  overflow-y: auto;
}

.no-herb-selected {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #888;
  font-style: italic;
}

.herb-detail h3 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.herb-image-large {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 15px;
}

.herb-image-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.herb-info p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.view-more-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.view-more-btn:hover {
  background-color: #7a4232;
}

.pie-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pie-chart {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 20px;
}

.pie-segments {
  position: relative;
  width: 100%;
  height: 100%;
}

.pie-segment {
  position: absolute;
  width: 50%;
  height: 100%;
  transform-origin: right center;
  left: 0;
  top: 0;
  transition: transform 0.3s ease;
}

.pie-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 8px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  margin-right: 6px;
}

.legend-label {
  font-size: 12px;
  margin-right: 4px;
  white-space: nowrap;
}

.legend-value {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
}

/* 药材属性与特性分析视图样式 */
.properties-view {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.properties-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .properties-content {
    grid-template-columns: 1fr;
  }
}

.properties-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.herb-selector {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--background-color);
}

.herb-selector h3 {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.herb-search {
  margin-bottom: 15px;
}

.herb-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.herb-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 15px;
}

.herb-list-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.herb-list-item:last-child {
  border-bottom: none;
}

.herb-list-item:hover {
  background-color: rgba(141, 77, 59, 0.1);
}

.herb-list-item.selected {
  background-color: rgba(141, 77, 59, 0.2);
}

.herb-name {
  font-weight: 500;
}

.herb-category {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

.selected-herbs h4 {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--primary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.8rem;
}

.selected-tag button {
  border: none;
  background: none;
  color: white;
  margin-left: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 4px;
}

.dimension-selector, .view-mode-selector {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--background-color);
}

.dimension-selector h3, .view-mode-selector h3 {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.dimension-options, .mode-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dimension-option, .mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dimension-option input, .mode-option input {
  cursor: pointer;
}

.properties-main {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-header {
  text-align: center;
  margin-bottom: 20px;
}

.chart-header h2 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.chart-description {
  color: var(--text-color);
  opacity: 0.7;
}

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px;
  margin: 20px 0;
}

.empty-chart {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
  width: 100%;
  color: #888;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.radar-chart-container, .scatter-plot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-legend, .scatter-legend {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.axis-info {
  width: 100%;
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}

.property-analysis {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.property-analysis h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.analysis-content p {
  margin-bottom: 10px;
}

.analysis-list {
  padding-left: 20px;
}

.analysis-list li {
  margin-bottom: 8px;
}

.empty-analysis {
  color: #888;
  font-style: italic;
  text-align: center;
}

/* 药材关联与网络视图样式 */
.relations-view {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.relations-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .relations-controls {
    grid-template-columns: 1fr;
  }
}

.control-panel, .network-stats {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--background-color);
}

.control-panel h3, .network-stats h3 {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  color: var(--primary-color);
}

.control-group {
  margin-bottom: 15px;
}

.control-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.control-group input[type="range"] {
  width: 100%;
  margin: 8px 0;
}

.control-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
}

.button-group {
  display: flex;
  gap: 10px;
}

.button-group button {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.button-group button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.checkbox-group {
  margin-top: 5px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
}

.stat-label {
  font-weight: 500;
  color: var(--text-color);
}

.stat-value {
  font-weight: bold;
  color: var(--primary-color);
}

.network-container {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  height: 600px;
  position: relative;
}

.empty-network {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #888;
  font-style: italic;
}

.selected-node-info {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.selected-node-info h4 {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.node-details p {
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-herbs {
  margin-top: 10px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  background-color: rgba(228, 187, 151, 0.1);
  border-radius: 4px;
}

.related-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.relation-type {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.relation-name {
  font-weight: 500;
  margin-right: 8px;
}

.relation-info {
  color: var(--secondary-color);
  font-size: 0.8rem;
  margin-left: auto;
}

.network-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .network-detail {
    grid-template-columns: 1fr;
  }
}

.cluster-analysis, .relation-types {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--background-color);
}

.cluster-analysis h3, .relation-types h3 {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  color: var(--primary-color);
}

.cluster-content p {
  margin-bottom: 15px;
}

.cluster-groups {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.cluster-group {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
}

.group-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: rgba(228, 187, 151, 0.2);
}

.group-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 10px;
}

.group-name {
  font-weight: 500;
  flex-grow: 1;
}

.group-count {
  background-color: var(--primary-color);
  color: white;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.8rem;
}

.group-members {
  padding: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-tag, .more-tag {
  display: inline-flex;
  align-items: center;
  background-color: rgba(141, 77, 59, 0.1);
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.member-tag:hover {
  background-color: rgba(141, 77, 59, 0.2);
}

.member-tag.selected {
  background-color: var(--primary-color);
  color: white;
}

.more-tag {
  background-color: rgba(141, 77, 59, 0.05);
  color: #888;
}

.type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.type-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
}

.type-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 10px;
}

.type-name {
  font-weight: 500;
  width: 80px;
}

.type-desc {
  color: var(--text-color);
  font-size: 0.9rem;
}

/* SVG网络图元素样式 */
.network-node {
  cursor: pointer;
  transition: r 0.2s ease;
}

.network-node:hover {
  stroke-width: 2;
}

.network-link {
  pointer-events: none;
}

.node-label {
  pointer-events: none;
  user-select: none;
}

/* 地理与历史数据视图样式 */
.geographic-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.map-controls {
  padding: 15px;
  background-color: var(--light-background);
  border-bottom: 1px solid var(--border-color);
}

.view-mode-buttons h3,
.timeline-control h3,
.version-selector h3,
.map-legend h4 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: var(--text-dark);
}

.button-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.button-group button {
  padding: 8px 12px;
  background-color: #f0f0f0;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: all 0.2s;
}

.button-group button:hover {
  background-color: #e0e0e0;
}

.button-group button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.timeline-control {
  margin: 15px 0;
}

.timeline-slider {
  position: relative;
  height: 60px;
  padding: 10px 0;
  margin: 0 10px;
}

.timeline-track {
  height: 4px;
  background-color: #ddd;
  position: relative;
  margin: 20px 0;
}

.timeline-point {
  position: absolute;
  transform: translateX(-50%);
  cursor: pointer;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  background-color: var(--secondary-color);
  border-radius: 50%;
  position: relative;
  top: -4px;
  transition: all 0.2s;
}

.timeline-point.active .timeline-marker {
  background-color: var(--primary-color);
  width: 16px;
  height: 16px;
  top: -6px;
}

.timeline-label {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-dark);
}

.timeline-point.active .timeline-label {
  font-weight: bold;
  color: var(--primary-color);
}

.version-selector {
  margin: 15px 0;
  padding: 10px;
  background-color: rgba(var(--primary-rgb), 0.1);
  border-radius: 5px;
}

.version-selector select {
  padding: 8px;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  margin: 5px 0;
}

.version-info {
  font-size: 0.8rem;
  color: var(--text-medium);
  margin: 5px 0 0 0;
}

.map-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-color);
}

.zoom-controls {
  display: flex;
  gap: 5px;
}

.zoom-controls button {
  width: 30px;
  height: 30px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-controls button:hover {
  background-color: var(--light-background);
}

.map-legend {
  padding: 10px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 150px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 5px 0;
}

.legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
}

.legend-text {
  font-size: 0.85rem;
  color: var(--text-dark);
}

.legend-gradient {
  height: 15px;
  width: 100%;
  background: linear-gradient(to right, rgba(255,0,0,0.1), rgba(255,0,0,0.8));
  border-radius: 2px;
  margin: 5px 0;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-medium);
}

.map-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  flex-grow: 1;
  overflow: hidden;
}

.map-container {
  overflow: hidden;
  background-color: #f9f9f9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.china-map {
  width: 90%;
  height: 90%;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

.map-sidebar {
  padding: 15px;
  background-color: white;
  border-left: 1px solid var(--border-color);
  overflow: auto;
}

.herb-origin-list h3,
.region-stats h3,
.version-diff h3,
.region-herbs h4,
.diff-examples h4 {
  margin: 0 0 15px 0;
  color: var(--text-dark);
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.origin-herbs {
  max-height: calc(100vh - 350px);
  overflow-y: auto;
}

.origin-herb-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s;
}

.origin-herb-item:hover {
  background-color: var(--light-background);
}

.herb-name {
  font-weight: 500;
  color: var(--text-dark);
}

.herb-origin {
  font-size: 0.85rem;
  color: var(--text-medium);
}

.region-bars {
  margin-bottom: 20px;
}

.region-bar-item {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.region-bar-item:hover,
.region-bar-item.selected {
  background-color: var(--light-background);
}

.region-name {
  font-weight: 500;
  color: var(--text-dark);
}

.region-bar-wrapper {
  height: 10px;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.region-bar {
  height: 100%;
  border-radius: 5px;
}

.region-value {
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-medium);
}

.region-herbs {
  padding: 15px;
  background-color: var(--light-background);
  border-radius: 4px;
  margin-top: 15px;
}

.region-herb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-herb-tag {
  padding: 5px 10px;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  border-radius: 12px;
  font-size: 0.85rem;
}

.compare-info {
  margin-bottom: 15px;
  color: var(--text-medium);
  font-size: 0.9rem;
}

.diff-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.diff-stat-item {
  text-align: center;
  padding: 10px;
  background-color: var(--light-background);
  border-radius: 4px;
}

.diff-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-medium);
  margin-bottom: 5px;
}

.diff-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary-color);
}

.diff-examples {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-top: 15px;
  padding: 15px;
}

.diff-example-item {
  display: flex;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--border-light);
}

.diff-example-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.diff-herb {
  flex: 0 0 60px;
  font-weight: 500;
  color: var(--text-dark);
}

.diff-content {
  flex: 1;
}

.diff-content p {
  margin: 5px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.old-version {
  color: #d32f2f;
  font-weight: 500;
}

.new-version {
  color: #388e3c;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .map-content {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  
  .map-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: 300px;
  }
  
  .timeline-label {
    font-size: 0.7rem;
  }
}

/* 文本分析视图样式 */
.textual-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.text-controls {
  background-color: #f8f3ed;
  padding: 15px 20px;
  border-bottom: 1px solid #e6d5c1;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.view-mode-buttons h3,
.herb-search-box h3 {
  font-size: 16px;
  margin: 0 0 10px 0;
  color: #5d4037;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-group button {
  padding: 6px 12px;
  background-color: #f1e7d7;
  border: 1px solid #d7c4ab;
  border-radius: 4px;
  color: #6d4c41;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.button-group button:hover {
  background-color: #e6d5c1;
}

.button-group button.active {
  background-color: #8d5a3f;
  color: white;
  border-color: #6d4c41;
}

.herb-search-box {
  flex-grow: 1;
  min-width: 300px;
}

.search-with-button {
  display: flex;
  gap: 8px;
}

.search-with-button input {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #d7c4ab;
  border-radius: 4px;
  background-color: #fff;
  color: #5d4037;
}

.search-with-button button {
  padding: 8px 12px;
  background-color: #8d5a3f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.quick-herb-buttons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quick-herb-buttons span {
  color: #5d4037;
  font-size: 14px;
}

.quick-herb-btn {
  padding: 4px 8px;
  background-color: #f1e7d7;
  border: 1px solid #d7c4ab;
  border-radius: 4px;
  color: #6d4c41;
  cursor: pointer;
  font-size: 13px;
}

.quick-herb-btn:hover {
  background-color: #e6d5c1;
}

.text-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #fff;
}

/* 词云样式 */
.wordcloud-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wordcloud-container h2 {
  font-size: 24px;
  margin: 0 0 5px 0;
  color: #5d4037;
}

.chart-description {
  color: #7d6358;
  font-size: 14px;
  margin: 0 0 20px 0;
}

.wordcloud-display {
  background-color: #f8f3ed;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.cloud-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  max-width: 800px;
}

.cloud-word {
  display: inline-block;
  color: #8d4e31;
  padding: 3px;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}

.cloud-word:hover {
  transform: scale(1.2) !important;
  color: #d7591d;
}

.loading-cloud {
  color: #8d6a58;
  font-size: 18px;
}

.wordcloud-stats {
  padding: 15px;
  background-color: #f8f3ed;
  border-radius: 8px;
}

.wordcloud-stats h3 {
  font-size: 18px;
  margin: 0 0 15px 0;
  color: #5d4037;
}

.word-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.word-stat-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.word-text {
  font-weight: 500;
  color: #5d4037;
}

.word-bar-wrapper {
  height: 8px;
  background-color: #e9e3db;
  border-radius: 4px;
  overflow: hidden;
}

.word-bar {
  height: 100%;
  border-radius: 4px;
}

.word-count {
  font-size: 12px;
  text-align: right;
  color: #8d6a58;
}

/* 历代评价样式 */
.historical-container {
  display: flex;
  flex-direction: column;
}

.historical-quotes {
  margin-top: 20px;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #d7c4ab;
  left: 20px;
  margin-left: -2px;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 50px;
}

.timeline-marker {
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8d5a3f;
  border: 4px solid #f8f3ed;
  box-shadow: 0 0 0 4px rgba(141, 90, 63, 0.2);
}

.timeline-content {
  background: #f8f3ed;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.period-title {
  color: #5d4037;
  margin: 0 0 10px 0;
  font-size: 18px;
  border-bottom: 1px solid #e6d5c1;
  padding-bottom: 8px;
}

.quote-content {
  padding: 15px;
  background-color: #fff;
  border-radius: 6px;
  border-left: 4px solid #8d5a3f;
}

.quote-text {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #5d4037;
  line-height: 1.5;
}

.quote-source {
  margin: 0;
  font-style: italic;
  text-align: right;
  color: #8d6a58;
  font-size: 14px;
}

.no-herb-selected-for-text {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  background-color: #f8f3ed;
  border-radius: 8px;
  color: #8d6a58;
  font-size: 16px;
}

/* 情感分析样式 */
.sentiment-container {
  display: flex;
  flex-direction: column;
}

.sentiment-content {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 992px) {
  .sentiment-content {
    grid-template-columns: 7fr 3fr;
  }
}

.sentiment-chart {
  background-color: #f8f3ed;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  height: 400px;
}

.chart-labels {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.y-axis-label {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 14px;
  color: #8d6a58;
  white-space: nowrap;
}

.x-axis-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #8d6a58;
}

.stacked-bars-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 300px;
  padding-bottom: 30px;
}

.stacked-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}

.stacked-bar {
  width: 40px;
  height: 300px;
  display: flex;
  flex-direction: column-reverse;
}

.bar-segment {
  width: 100%;
  transition: height 0.3s;
}

.bar-segment.positive {
  background-color: #5d8c61;
}

.bar-segment.neutral {
  background-color: #bfb48f;
}

.bar-segment.negative {
  background-color: #c75e4e;
}

.period-label {
  margin-top: 10px;
  font-size: 14px;
  color: #5d4037;
  text-align: center;
}

.sentiment-legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 15px;
  height: 15px;
  border-radius: 3px;
}

.legend-color.positive {
  background-color: #5d8c61;
}

.legend-color.neutral {
  background-color: #bfb48f;
}

.legend-color.negative {
  background-color: #c75e4e;
}

.legend-label {
  font-size: 14px;
  color: #5d4037;
}

.sentiment-analysis {
  background-color: #f8f3ed;
  border-radius: 8px;
  padding: 20px;
}

.sentiment-analysis h3 {
  font-size: 18px;
  margin: 0 0 15px 0;
  color: #5d4037;
  border-bottom: 1px solid #e6d5c1;
  padding-bottom: 8px;
}

.sentiment-analysis p {
  margin: 0 0 15px 0;
  font-size: 15px;
  color: #5d4037;
  line-height: 1.6;
}

.sentiment-analysis strong {
  color: #8d5a3f;
}

/* 主题演化样式 */
.evolution-container {
  display: flex;
  flex-direction: column;
}

.evolution-content {
  margin-top: 20px;
}

.evolution-chart {
  background-color: #f8f3ed;
  border-radius: 8px;
  padding: 30px 20px;
  overflow-x: auto;
}

.chart-header {
  margin-bottom: 20px;
  margin-left: 150px;
}

.time-periods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.time-label {
  text-align: center;
  font-size: 14px;
  color: #5d4037;
  font-weight: 500;
}

.themes-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.theme-row {
  display: flex;
  align-items: center;
}

.theme-label {
  width: 150px;
  padding-right: 15px;
  font-size: 14px;
  color: #5d4037;
  font-weight: 500;
  text-align: right;
}

.theme-evolution {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex-grow: 1;
}

.evolution-segment {
  margin: 0 auto;
  border: 1px solid rgba(141, 77, 59, 0.3);
  box-shadow: 0 0 5px rgba(141, 77, 59, 0.1);
  transition: transform 0.2s;
}

.evolution-segment:hover {
  transform: scale(1.1);
}

.evolution-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: #5d4037;
  font-size: 14px;
}

.bubble-legend {
  display: flex;
  gap: 15px;
}

.bubble-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bubble {
  border-radius: 50%;
  border: 1px solid rgba(141, 77, 59, 0.3);
}

.bubble.low {
  width: 15px;
  height: 15px;
  background-color: rgba(141, 77, 59, 0.2);
}

.bubble.medium {
  width: 25px;
  height: 25px;
  background-color: rgba(141, 77, 59, 0.5);
}

.bubble.high {
  width: 35px;
  height: 35px;
  background-color: rgba(141, 77, 59, 0.8);
}

.evolution-analysis {
  background-color: #f8f3ed;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.evolution-analysis h3 {
  font-size: 18px;
  margin: 0 0 15px 0;
  color: #5d4037;
  border-bottom: 1px solid #e6d5c1;
  padding-bottom: 8px;
}

.evolution-analysis p {
  margin: 0 0 15px 0;
  font-size: 15px;
  color: #5d4037;
  line-height: 1.6;
}

.evolution-analysis strong {
  color: #8d5a3f;
} 